package com.lieve.servicea;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.ForkJoinWorkerThread;

/**
 * @author sunlijiang
 * @date 2020/3/21
 */
public class ParallelStream {

    @Test
    void parallelStream() {
        List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        numbers.parallelStream().forEach(System.out::println);
    }

    @Test
    void forkJoinPool() {
        ForkJoinPool forkJoinPool = new ForkJoinPool();

        ForkJoinWorkerThread forkJoinWorkerThread;

        ForkJoinTask forkJoinTask;

        Executors.newWorkStealingPool();
    }
}
